com.cete.dynamicpdf.merger
Class ImportedPageContents
Example : This example shows you how to import one page of an existing PDF and save it as a another PDF.
import com.cete.dynamicpdf.*;
import com.cete.dynamicpdf.merger.*;
public class MyClass {
public static void main(String args[]) {
// Create a PDF Document
Document document = new Document();
// Create a Page and add it to the document
Page page = new Page();
document.getPages().add( page );
// Create an ImportedPageContents object
ImportedPageContents contents = new ImportedPageContents( "[physicalpath]/ImportPDF.pdf", 2 );
// Create an ImportedPageData and add it to the page
ImportedPageData data = new ImportedPageData(contents, -200, -100, 0.24f );
page.getElements().add( data );
// Save the PDF
document.draw( "[physicalpath]/MyDocument.pdf" );
}
}